<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // var str = "kaikeba";// k - 107
        // var str2 = "v"; //v - 118

        var china1 = "中";
        var china2 = "文中";
        // console.log(china2.charCodeAt());//20013   25991

        console.log(china2.charCodeAt(-10));
        

        // console.log(str > str2);
        /*
            如果比较字符串，比较的是Unicode编码的大小

            str.charCodeAt(index) 用于获取当前字符串的unicode编码
                - index :字符串的索引值(下标)，如果不给，默认为0
                - 如果下标不存在的值，那么会返回给你一个NaN

        */
    </script>
</body>
</html>